package com.lingxu.module.collection.controller;

import com.lingxu.base.common.api.vo.Result;
import com.lingxu.module.collection.entity.CityInfo;
import com.lingxu.module.collection.entity.CollectionMonitorArea;
import com.lingxu.module.collection.entity.CollectionMonitorSearchVo;
import com.lingxu.module.collection.service.ICollectionMonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Api(tags="数据采集监控")
@RestController
@RequestMapping("/collectionMonitor")
public class CollectionMonitorController {

    @Resource
    private ICollectionMonitorService iCollectionMonitorService;

    @ApiOperation(value="数据采集监控-获取统计信息", notes="数据采集监控-数据采集监控")
    @PostMapping(value = "/getCollectionMonitorCountInfo")
    public Result<?> getCollectionMonitorCountInfo(@RequestBody CollectionMonitorSearchVo vo) {
        return Result.ok(iCollectionMonitorService.getCollectionMonitorCountInfo(vo));
    }
    @ApiOperation(value="数据采集监控-获取时间统计信息", notes="数据采集监控-获取时间统计信息")
    @PostMapping("/getCollectionMonitorTimeInfo")
    public Result<?> getCollectionMonitorTimeInfo(@RequestBody CollectionMonitorSearchVo vo) {
        return Result.ok(iCollectionMonitorService.getCollectionMonitorTimeInfo(vo));
    }
    @ApiOperation(value="数据采集监控-获取地区统计信息", notes="数据采集监控-获取地区统计信息")
    @PostMapping("/getCollectionMonitorAreaInfo")
    public Result<?> getCollectionMonitorAreaInfo(@RequestBody CollectionMonitorSearchVo vo) {
        return Result.ok(iCollectionMonitorService.getCollectionMonitorAreaInfo(vo));
    }
    @ApiOperation(value="数据采集监控-获取地区统计信息最新", notes="数据采集监控-获取地区统计信息最新")
    @PostMapping("/getCollectionMonitorAreaInfoNew")
    public Result<?> getCollectionMonitorAreaInfoNew(@RequestBody CollectionMonitorSearchVo vo) {
        CityInfo cityInfo=new CityInfo();
        List<CollectionMonitorArea> collectList = iCollectionMonitorService.getCollectionMonitorAreaInfo(vo);
        cityInfo.setCollectList(collectList);
        List<CollectionMonitorArea> warnList = iCollectionMonitorService.getWarnListAreaInfo(vo);
        cityInfo.setWarnList(warnList);
        return Result.ok(cityInfo);
    }

    @ApiOperation(value="数据采集监控-获取上传信息", notes="数据采集监控-获取上传信息")
    @PostMapping("/getCollectionMonitorList")
    public Result<?> getCollectionMonitorList() {
        return Result.ok(iCollectionMonitorService.getCollectionMonitorList());
    }


}
